package org.dandsoft.blackbox;

import java.io.Serializable;

/**
 * User: dvilyuzhanin
 * Date: 16.01.2009 17:02:35
 */
public class Time implements Serializable {
    private static final long serialVersionUID = -8671005582518023765L;

    public final static Time NULL = new Time(0);
    private long value;

    public Time(long value) {
        this.value = value;
    }

    public long getValue() {
        return value;
    }

    public Time incrent() {
        return new Time(value + 1);
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Time time = (Time) o;

        if (value != time.value) return false;

        return true;
    }

    public int hashCode() {
        return (int) (value ^ (value >>> 32));
    }


    public String toString() {
        return "Time{" +
               "value=" + value +
               '}';
    }
}
